package cn.itrigger.dynamic.sql.util;

import java.util.Optional;

/**
 * @author admin
 * @date 2018/9/25
 **/
public interface StringUtilities {

    static String spaceAfter(Optional<String> in) {
        return in.map(s -> s + " ")
                .orElse("");
    }

    static String spaceAfter(String in) {
        return in + " ";
    }

    static String spaceBefore(Optional<String> in) {
        return in.map(s -> " " + s)
                .orElse("");
    }

    static String spaceBefore(String in) {
        return " " + in;
    }
}
